package io.framework.modules.platform.hzt.controller;

import cn.com.digitalhainan.apione.sdk.ContentBody;
import cn.com.digitalhainan.apione.sdk.HttpCaller;
import cn.com.digitalhainan.apione.sdk.HttpParameters;
import cn.com.digitalhainan.apione.sdk.HttpReturn;
import org.apache.commons.collections.MapUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @auther 大雄
 * @create 2025-08-12 14:38
 */
public class bb {
    public static void main(String[] args) {
        String token = "13vahdjaflk";
        String contentJson = "";
        // 开放平台发放的accessKey
        String accessKey = "AKb6dcdd2744fd4f9ea837b8ffefa003e4";
        // 开放平台发放的secretKey
        String secretKey = "SKa0c453d7d228411182315ed88dc81307";
        // 统一认证平台的appKey
        String appKey = "AKe1238e61f33e48f1921d2bb4e562ab00";
        // api接口
        String api = "uaaUserDetailByToken";

        String region = "INTER";
        String requestUrl = "https://api-one.digitalhainan.com.cn/apione";
        ContentBody contentBody = new ContentBody(contentJson);
        Map<String, String> header = new HashMap<>();
        header.put("Authorization", "Bearer " + token);
        header.put("Uaa-App-Key", appKey);
        header.put("Uaa-Tenant-Id", "1");
        //拼装业务信息
        HttpParameters parameters = HttpParameters.builder()
                .api(api)
                .headerParamsMap(header)
                .region(region)
                .accessKey(accessKey)
                .secretKey(secretKey)
                .contentBody(contentBody)
                .requestUrl(requestUrl)
                .build();
        //请求开发服务，获取response
        HttpReturn call = HttpCaller.getInstance().call(parameters);

        String response = call.getResponse();
        System.out.println("海政通请求的accessKey++++++++++" + accessKey);
        System.out.println("海政通请求的secretKey++++++++++" + secretKey);
        System.out.println("海政通请求的appKey++++++++++" + appKey);
        System.out.println("海政通请求的api++++++++++" + api);
        System.out.println("海政通请求的requestUrl++++++++++" + requestUrl);
        System.out.println("海政通返回++++++++++" + response);

    }
}
